
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;


public class ServiceTest {
	public static void main(String[] args) {
		
		ApplicationContext ctx = 
//			new ClassPathXmlApplicationContext(new String[]{
//				"applicationContext.xml","applicationContext-compass.xml","applicationContext-security.xml"});
			new FileSystemXmlApplicationContext(
				new String[] { "/WebRoot/WEB-INF/applicationContext.xml"
						});
//		net.shopxx.service.AdminService adminService = (AdminService) ctx.getBean("adminServiceImpl");
//		System.out.println(adminService.getAll().size());
		
//		BaseService  service = (BaseService) ctx.getBean("flagshipStoreServiceImpl");
//		BaseService  service = (BaseService) ctx.getBean("productServiceImpl");
//		OrderService  service = (OrderService) ctx.getBean("orderServiceImpl");
//		MemberService service = (MemberService) ctx.getBean("memberServiceImpl");
	//	ProductCategoryService service = (ProductCategoryService) ctx.getBean("productCategoryServiceImpl");
	//	List<ProductCategory> ls = service.getAll();
//	/	FlagshipStore entity = new FlagshipStore();
//		String id = "1224ddndfdfaf";
//		String mid ="4028818c38576d1e01385778a9b20001";
//		Member member = service.get("mid");
//		System.out.println(member.getFlagshipStore().getStore_name());
		
//		entity = (FlagshipStore)service.get(id);
//		entity.setStore_name("222");
//		service.update(entity);
		
//		String id = UUID.randomUUID().toString();
//		entity.setId(id.length()>32?id.substring(0, 32):id);
//		Member meber = new Member();
//		meber.setId("4028818c38576d1e01385778a9b20001");
//		entity.setMember(meber);
//		entity.setStatus("0");
//		entity.setStore_banner("/bath/1.png");
//		entity.setStore_logo("/bath/2.png");
//		service.save(entity);
//		List<FlagshipStore> ls = service.getAll();
//		System.out.println(ls.size());
//		
	//	for (ProductCategory product : ls) {
		//	System.out.println(product.getIcon());
//			if(product.getMember() != null)
//			System.out.println(product.getId()+">>"+product.getMember().getUsername());
	//	}
		
//		System.out.println("list size is " + service.getAll().size());
//		System.out.println(DigestUtils.md5Hex("admin"));
	}
}
